package cn.edu.neusoft.maxingxin231.yuejian06.Model;



import java.util.List;

import cn.edu.neusoft.maxingxin231.yuejian06.Bean.PostBean;
import cn.edu.neusoft.maxingxin231.yuejian06.Iface.PostIface;
import cn.edu.neusoft.maxingxin231.yuejian06.Listener.ListListener;
import cn.edu.neusoft.maxingxin231.yuejian06.Service.LoginService;
import cn.edu.neusoft.maxingxin231.yuejian06.Service.Server;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

public class PostModel extends RetrofitBaseModel implements PostIface<PostBean> {
   private LoginService loginService;
   private Retrofit retrofit;

   public PostModel(){
       retrofit = getRetrofit();
       loginService = getLoginService();
   }

    @Override
    public void getPostList( final ListListener<PostBean> listListener) {
        Call<List<PostBean>> call = loginService.postList();
        callenqueueList(call,listListener);
    }

    @Override
    public void getUserPostList(String user_id, ListListener<PostBean> listListener) {
        Call<List<PostBean>> call = loginService.userpostlist(user_id);
        callenqueueList(call,listListener);
    }
}
